from twisted.enterprise import adbapi

class DB(adbapi.ConnectionPool) : 
    def __init__(self, dbapiName, *connargs, **connkw):
        adbapi.ConnectionPool.__init__(self, dbapiName, *connargs, **connkw)
        
    def runCommand(self, *args, **kw) :
        return self.runInteraction(self._runCommand, *args, **kw)        
        
    def _runCommand(self, trans, *args, **kw) :
        r = trans.execute(*args, **kw)
        return { 'affected_rows':r  ,  'sql':args[0]  }
